package com.shisfish.library.Impl;

import java.util.List;
import java.util.Map;

import org.springframework.context.ApplicationContext;

import com.shisfish.library.Inter.IBookInter;
import com.shisfish.library.Model.Book;
import com.shisfish.library.Utils.Global.GetACXmlUtils;

public class BookImpl implements IBookInter {

	private ApplicationContext ac = GetACXmlUtils.getACXml();
	IBookInter mapper = (IBookInter) ac.getBean("bookMapper");
	
	@Override
	public int insertOne(Book t) {
		// TODO Auto-generated method stub
		return mapper.insertOne(t);
	}

	@Override
	public int insertAll(List<Book> list) {
		// TODO Auto-generated method stub
		return mapper.insertAll(list);
	}

	@Override
	public int updateOne(Book t) {
		// TODO Auto-generated method stub
		return mapper.updateOne(t);
	}

	@Override
	public int updateAll(List<Book> list) {
		// TODO Auto-generated method stub
		return mapper.updateAll(list);
	}

	@Override
	public List<Book> selectById(int id) {
		// TODO Auto-generated method stub
		return mapper.selectById(id);
	}

	@Override
	public List<Book> selectByKey(String key) {
		// TODO Auto-generated method stub
		return mapper.selectByKey(key);
	}

	@Override
	public List<Book> selectAll() {
		// TODO Auto-generated method stub
		return mapper.selectAll();
	}

	@Override
	public int deleteOneById(int id) {
		// TODO Auto-generated method stub
		return mapper.deleteOneById(id);
	}

	@Override
	public int deleteAllById(List<?> ids) {
		// TODO Auto-generated method stub
		return mapper.deleteAllById(ids);
	}

	@Override
	public int deleteOneByKey(String key) {
		// TODO Auto-generated method stub
		return mapper.deleteOneByKey(key);
	}

	@Override
	public int deleteAllByKey(List<?> keys) {
		// TODO Auto-generated method stub
		return mapper.deleteAllByKey(keys);
	}

	@Override
	public List<Book> selectByCategory(String category, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByCategory(category, currentPage, pageSize);
	}

	@Override
	public int countByCategory(String category) {
		// TODO Auto-generated method stub
		return mapper.countByCategory(category);
	}

	@Override
	public List<Book> selectByTitle(String title, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByTitle(title, currentPage, pageSize);
	}

	@Override
	public List<Book> selectByAuthor(String author, int currentPage,
			int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByAuthor(author, currentPage, pageSize);
	}

	@Override
	public List<Book> selectByISBN(String ISBN, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByISBN(ISBN, currentPage, pageSize);
	}

	@Override
	public List<Book> selectByPage(int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByPage(currentPage, pageSize);
	}

	@Override
	public int countAll() {
		// TODO Auto-generated method stub
		return mapper.countAll();
	}

	@Override
	public int countByTitle(String title) {
		// TODO Auto-generated method stub
		return mapper.countByTitle(title);
	}

	@Override
	public int countByAuthor(String author) {
		// TODO Auto-generated method stub
		return mapper.countByAuthor(author);
	}

	@Override
	public int countByISBN(String ISBN) {
		// TODO Auto-generated method stub
		return mapper.countByISBN(ISBN);
	}

	@Override
	public int countFuzzy(List<String> singleString) {
		// TODO Auto-generated method stub
		return mapper.countFuzzy(singleString);
	}

	@Override
	public List<Book> selectFuzzy(List<String> singleString, int currentPage,
			int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectFuzzy(singleString, currentPage, pageSize);
	}

	@Override
	public List<Map<String, Object>> selectOtherBooks(int number) {
		// TODO Auto-generated method stub
		return mapper.selectOtherBooks(number);
	}

	@Override
	public List<Map<String, Object>> selectFuzzyLess(List<String> singleString,
			int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectFuzzyLess(singleString, currentPage, pageSize);
	}

}
